import { useState, useEffect } from 'react';

import { findFilmsPage } from '@/api/MaiZuo';

const useNowPlaying = () => {
  const [list, setList] = useState([]);

  useEffect(() => {
    findFilmsPage().then((res) => setList(res.films));
    return () => {};
  }, []);

  return {
    list,
  };
};

export { useNowPlaying };
